{% extends 'base.html' %}
{% block content %}
<div class="container">
    <br>
    <div class="row">
         <form class="col s6 push-s3" action="signup" method="post">
             {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
            <div class="row">
                {% for catagory, message in messages %}
                <div class="col s12 valign-wrapper white-text">
                    <div class="{{ catagory }}">{{ message }}</div>
                </div>
             {% endfor %}
            {% endif %}
            {% endwith %}
            </div>
            <div class="row">
                {{ form.hidden_tag() }}
            </div>
             <div class="row">
                 <div class="input-field col s12">
                     {{ form.UserEmail }}
                     <!--suppress XmlInvalidId -->
                     <label for="UserEmail">邮箱</label>
                     <ul class="errors red-text">
                        {% for error in form.errors.UserEmail %}
                        <li>{{ error }}</li>
                    </ul>
                    {% endfor %}
                </div>
             </div>
             <div class="row">
                 <div class="input-field col s12">
                     {{ form.UserName }}
                     <!--suppress XmlInvalidId -->
                     <label for="UserName">昵称</label>
                     <ul class="errors red-text">
                        {% for error in form.errors.UserName %}
                        <li>{{ error }}</li>
                    </ul>
                    {% endfor %}
                 </div>
             </div>
             <div class="row">
                 <div class="input-field col s12">
                     {{ form.PassWord }}
                     <!--suppress XmlInvalidId -->
                     <label for="PassWord">密码</label>
                     <ul class="errors red-text">
                        {% for error in form.errors.PassWord %}
                        <li>{{ error }}</li>
                    </ul>
                    {% endfor %}
                 </div>
             </div>
              <button class="btn waves-effect waves-light" type="submit" name="action">注册
                    <i class="material-icons right">send</i>
              </button>
              &#x3000;已有账号？ <a href="{{ url_for('login')}}">登录</a>
         </form>
    </div>
</div>
{% endblock %}